package com.filldream.fastboot.common.okutil.cls.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;

@Data
public class DepthList {

    @ApiModelProperty(value = "文章ID")
    private Long id;

    @ApiModelProperty(value = "创建时间")
    private Long ctime;

    @ApiModelProperty(value = "文章标题")
    private String title;

    @ApiModelProperty(value = "配图和img一致")
    private String image;

    private String source;

    @ApiModelProperty(value = "文章简介")
    private String brief;

    @ApiModelProperty(value = "文章详细内容跳转地址")
    public String getLinkUrl() {
        return "https://www.cls.cn/detail/" + id;
    }

    @ApiModelProperty(value = "配图")
    public String getImg() {
        return image;
    }

    public Date toCreateTime(){
        if( ctime != null ){
            return new Date(ctime * 1000L);
        }
        return null;
    }

}